﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace JamesThew.Dashboard
{
    public partial class Dashboard : System.Web.UI.MasterPage
    {
        public String RightBar;

        protected void Page_Load(object sender, EventArgs e)
        {
            String RightBar = "";
            try
            {
                if (Session["UserLogin"] != null || Session["UserLevel"].ToString() != "1")
                {
                    RightBar += "<ul class='nav pull-right'>";
                    RightBar += "<li class='dropdown'>";
                    RightBar += "<a href='#about' class='dropdown-toggle' data-toggle='dropdown'>";
                    RightBar += Session["UserLogin"].ToString();
                    RightBar += "<b class='caret'></b></a><ul class='dropdown-menu'><li><a href='#'>My Profile</a></li><li><a href='Logout.aspx'>Log Out</a></li></ul></li></ul>";
                }
                else
                {
                    Response.Redirect("default.aspx");
                }
            }
            catch (Exception ex) {
                Response.Redirect("default.aspx");
            }
            this.RightBar = RightBar;
        }
    }
}